//
//  ViewController.swift
//  helloworld
//
//  Created by ap0stader on 2023/10/12.
//

import UIKit

class ViewController: UIViewController {

    override func viewDidLoad() {
        super.viewDidLoad()
        // Do any additional setup after loading the view.
    }
    
    let provincesArray : [String] = ["河北", "山东", "黑龙江", "辽宁"]
    let cityArray : [String] = ["石家庄", "济南", "哈尔滨", "沈阳"]
    var index: Int = 0
    
    @IBOutlet weak var province: UILabel!
    @IBOutlet weak var ans: UILabel!
    @IBAction func show(_ sender: Any) {
        ans.text = cityArray[index]
    }
    @IBAction func next(_ sender: Any) {
        index += 1
        if (index >= 4) {
            index = 0
        }
        ans.text = "？？？"
        province.text = provincesArray[index]
    }
}

